//	------------------------------------------------------------------------------------------------
//	File name:		PdbModuleDetails.cpp
//	Author:			Marc Ochsenmeier
//	Email:			marc@ochsenmeier.de
//	Web:			www.breakpoints.de - 
//	Date:			02.07.2009
//
//	Description:	Implementation of the Pdb Module details.
//
//	------------------------------------------------------------------------------------------------
#include "stdafx.h"

#include "PdbTranslationMaps.h"
#include "PdbModule.h"
#include "PdbParser.h"
#include "PdbModuleDetails.h"

CPdbModuleDetails::CPdbModuleDetails(CPdbModule* pPdbSymbol) : 
	m_pPdbSymbolParent(pPdbSymbol),
	m_bManagedCode(false),
	m_PdbLanguage(PdbLanguage_Unavailable),
	m_PdbTargetCPU(PdbTargetCPU_Unavailable)
{
}
CPdbModuleDetails::~CPdbModuleDetails()
{
}
std::wstring CPdbModuleDetails::GetName() const
{
	return m_pPdbSymbolParent->GetName();
}
void CPdbModuleDetails::SetCompilerName(wstring s)
{
	m_sCompilerName = s;
}
void CPdbModuleDetails::SetGetBackEndBuildNumber(wstring s)
{
	m_sBackEndBuildNumber = s;
}
void CPdbModuleDetails::SetManagedCode(bool b)
{
	m_bManagedCode = b;
}
PdbLanguage CPdbModuleDetails::GetLanguage() const
{
	return m_PdbLanguage;
}
bool CPdbModuleDetails::IsManagedCode() const
{
	return m_bManagedCode;
}
const std::wstring& CPdbModuleDetails::GetBackEndBuildNumber() const 
{
	return m_sBackEndBuildNumber;
}
const std::wstring& CPdbModuleDetails::GetCompilerName() const 
{
	return m_sCompilerName;
}
PdbTargetCPU CPdbModuleDetails::GetTargetCPU() const 
{
	return m_PdbTargetCPU;
}
PdbTargetCPU CPdbModuleDetails::MapMachineTypeToTargetCPU(DWORD dwType) const
{
	PdbTargetCPU targetCPU = PdbTargetCPU_Unknown;
	CPdbTranslationMaps::MapPdbTargetCPU::const_iterator it = CPdbTranslationMaps::mapPdbTargetCPU.find(dwType);
	if(it!=CPdbTranslationMaps::mapPdbTargetCPU.end())
	{
		targetCPU = it->second;
	}
	return targetCPU;
}